package com.ayit.car.car_data;

import java.util.*;

public class URLManager {
    private Queue<String> urlQueue = new LinkedList<>();
    private Set<String> urlSet = new HashSet<>();

    public void addUrl(String url) {
        if (!urlSet.contains(url)) {
            urlQueue.offer(url);
            urlSet.add(url);
        }
    }

    public String getNextUrl() {
        return urlQueue.poll();
    }

    public void addUrls(List<String> urls) {
        for (String url : urls) {
            addUrl(url);
        }
    }

    public boolean isEmpty() {
        return urlQueue.isEmpty();
    }
}
